<!doctype html>
<html lang="en">

<head>
    {{template "header" .}}
    <link href="https://cdn.bootcss.com/bootstrap-select/2.0.0-beta1/css/bootstrap-select.min.css" rel="stylesheet">

</head>
<body>
    <div class="wrapper">
        {{template "adminSidebar" .}}
        <div class="main-panel">
            {{template "nav" .}}
            <div class="content bg-white">
                <div class="container" style="text-align:center;">
                    {{if .isPostReq}} 
                        {{if .titleExist}}
                            <div class="alert alert-warning" style="background-color:#CFCFCF;border-radius: 20px;">
                                <a href="#" class="close" data-dismiss="alert">
                                        &times;
                                    </a>
                                <strong>提示！</strong>发表成功。
                            </div>
                        {{else}}
                            <div class="alert alert-warning" style="background-color:#CFCFCF;border-radius: 20px;">
                                <a href="#" class="close" data-dismiss="alert">
                                        &times;
                                    </a>
                                <strong>警告！</strong>标题不能为空。
                            </div>
                        {{end}}
                    {{end}}


                    <form method="POST" action="/admin/article/add" class="form-horizontal" role="form">
                        <button type="submit" style="margin:0px 0px 10px 0px;" class="btn btn-default">添 加 文 章</button>
                        <div class="form-group form-horizontal">
                            <label class="col-xs-4 col-sm-2 col-md-2 control-label" style="vertical-align:middle;text-align:center;">分 类：</label>
                            <div class="col-xs-8 col-sm-4 col-md-4">
                                <select id="usertype" name="articleCate" class="selectpicker show-tick form-control" title='请选择分类...' required data-live-search="true">
                                    {{range .categories}}
                                    <option value="{{.Name}}">{{.Name}}</option>
                                    {{end}}
                                </select>
                            </div>
                            <label class="col-xs-4 col-sm-2 col-md-2 control-label" style="vertical-align:middle;text-align:center;">标 签：</label>
                            <div class="col-xs-8 col-sm-4 col-md-4">
                                <select id="usertype" name="articleTags" class="selectpicker show-tick form-control" title='请选择标签...' multiple data-live-search="true">
                                    {{range .tags}}
                                    <option value="{{.Name}}">{{.Name}}</option>
                                    {{end}}
                                </select>
                            </div>
                        </div>
                        <div class="input-group" style="margin:0 auto;width:100%;">
                            <input name="articleTitle" type="text" class="form-control" placeholder="文章标题" style="border:2px solid #66615b;text-align:center;">
                        </div>
                        <div class="input-group" style="margin:0 auto;width:100%;margin:10px 0px 10px 0px;">
                            <input name="articleSummary" type="text" class="form-control" placeholder="文章摘要" style="border:2px solid #66615b;text-align:center;">
                        </div>
                        <div class="input-group" style="margin:0 auto;width:100%;margin:10px 0px 10px 0px;">
                            <textarea name="articleContent" class="form-control" rows="15" placeholder="文章内容" style="border:2px solid #66615b;"></textarea>
                        </div>
                    </form>
                </div>
            </div>
            {{template "footer" .}}
        </div>
    </div>
    <!--   Core JS Files   -->
    <script src="/assets/js/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script>
    
    <!-- Paper Dashboard Core javascript and methods for Demo purpose -->
    <script src="/assets/js/goodman.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap-select/2.0.0-beta1/js/bootstrap-select.min.js"></script>
</body>

</html>